<template>
  <section class="content-box">
    <icon-svg :icon-name="src"
              class-name="iconSty" />
    <div class="labelSty">【物流源】{{tip}}！</div>
  </section>
</template>


<script>
import { basic } from "@/api/index";

export default {
  name: "Success",
  data () {
    return {
      src: 'qiyong',
      tip: null
    };
  },
  computed: {
    emailToken () {
      return this.$route.query?.emailToken || null
    }
  },
  created () {
    this.emailConfirm();
  },
  methods: {
    async emailConfirm () {
      if (!this.emailToken) {
        console.log("====<emailToken", this.emailToken, this.$route)
        return false;
      }
      let { code, message } = await basic.getConsigneeEmailConfirm(this.emailToken)
        .catch(err => {
          this.src = 'cuowu1'
          this.tip = err?.message
        })

      this.src = code === 0 ? 'qiyong' : 'cuowu1'
      this.tip = message
    }
  }
};
</script>

<style lang="scss" scoped>
.content-box {
  width: 100vw;
  height: 100vh;
  background-color: var(--prev-bg-color);
  display: flex;
  // justify-content: center;
  align-items: center;
  flex-direction: column;
}
.iconSty {
  width: 100px !important;
  height: 100px !important;
  margin-top: 28vh;
}
.labelSty {
  margin-top: 40px;
  font-size: 20px;
}
</style>